<script setup>
import { ref, reactive } from 'vue'
import { useRouter } from 'vue-router';
const router = useRouter();
function handleBack(){
  router.push('/home');
}
</script>

<template>
  <div class="content-wrapper">
    <div class="number">404</div>
    <div class="text">页面不存在</div>
    <div class="back-btn" @click="handleBack">返回首页</div>
  </div>
</template>

<style lang="scss" scoped>
.content-wrapper {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  position: relative;
  overflow: hidden;

  &::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    animation: rotate 20s linear infinite;
  }

  .text,
  .number {
    position: relative;
    width: 600px;
    text-align: center;
    font-weight: 900;
    letter-spacing: 40px;
    font-style: oblique;
    transition: all 0.3s ease;
    
    &:hover {
      transform: scale(1.05);
    }
  }

  .number {
    margin: 100px 0 50px;
    font-size: 180px;
    background: linear-gradient(45deg, #12c2e9, #c471ed, #f64f59);
    background-size: 200% 200%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 2px 2px 20px rgba(0, 0, 0, 0.2);
    animation: gradient 3s ease infinite, float 6s ease-in-out infinite;
  }

  .text {
    font-size: 60px;
    color: #2c3e50;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
    animation: float 6s ease-in-out infinite;
    animation-delay: -3s;
  }

  .back-btn {
    margin-top: 40px;
    padding: 15px 40px;
    font-size: 18px;
    color: white;
    background: linear-gradient(45deg, #12c2e9, #c471ed);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;

    &:hover {
      transform: translateY(-3px);
      box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    }
  }
}

@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(18, 194, 233, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(18, 194, 233, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(18, 194, 233, 0);
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg) translate(-50%, -50%);
  }
  to {
    transform: rotate(360deg) translate(-50%, -50%);
  }
}
</style>
